package cn.starrysky108.simpleerp.core.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.connection.RedisConnectionFactory;
import org.springframework.integration.redis.util.RedisLockRegistry;

/**
 * spring integration 分布式锁配置类
 * @author Carl Lee
 */
@Configuration
public class RedisLockConfig {
    @Bean(destroyMethod = "destroy")
    public RedisLockRegistry redisLockRegistry(RedisConnectionFactory connectionFactory){
        return new RedisLockRegistry(connectionFactory, "lock");
    }
}
